package com.lc.pianostudent.dialog;

import android.content.Context;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;

import com.lc.pianostudent.R;
import com.zcx.helper.dialog.AppDialog;
import com.zcx.helper.glide.GlideLoader;

/**
 * Created by Administrator on 2017/8/12.
 */

public abstract class XingzuoDialog extends AppDialog {
    private int layoutResId;
    private String imgUrl = "";
    public XingzuoDialog(Context context, int layoutResId , String imgUrl) {

        super(context, R.style.Dialog);
        this.layoutResId = layoutResId;
        this.imgUrl = imgUrl;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(layoutResId);

        Window window = this.getWindow();
        WindowManager.LayoutParams lp = window.getAttributes();
        window .setGravity(Gravity.CENTER);
        lp.dimAmount = 0.3f;
        window .setAttributes(lp);

        this.setCanceledOnTouchOutside(true);


        ImageView imageView = findViewById(R.id.xingzuo_picture);
        GlideLoader.getInstance().get(imgUrl,imageView,R.mipmap.ic_action_discard);
    }



}
